import 'package:flutter_test/flutter_test.dart';
import 'package:xx_demo/utils/deferred_router.dart';

void main() {
  group('DeferredRouterManager Tests', () {
    test('should register and retrieve loaders', () {
      // 测试注册功能
      DeferredRouterManager.registerLoader(
        'test', 
        () async {}, 
        displayName: 'Test Library'
      );
      
      // 验证注册成功
      expect(DeferredRouterManager.isLibraryLoaded('test'), false);
    });

    test('should handle preload strategies', () {
      // 测试预加载策略
      SmartPreloadManager.setStrategy(PreloadStrategy.hybrid);
      SmartPreloadManager.setCriticalRoutes({'test'});
      
      // 验证策略设置
      expect(true, true); // 基本的验证，确保没有语法错误
    });
  });
}
